]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
params: Don't use Lang module
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 5 Jul 2019 21:36:30 +0000 (23:36 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 10 Jul 2019 22:09:09 +0000 (22:09 +0000)
To copy the passed in default parameters, we can just as well use
another Object.assign() call.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/616

js/misc/params.js

index 6878395e93480ef2e2728fc05f670696d45caa63..40dd9168ee15acc32e5ddf41cc16708daa83b2d4 100644 (file)
@@ -1,7 +1,5 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Lang = imports.lang;
-
 // parse:
 // @params: caller-provided parameter object, or %null
 // @defaults-provided defaults object
@@ -23,7 +21,6 @@ function parse(params = {}, defaults, allowExtras) {
                 throw new Error(`Unrecognized parameter "${prop}"`);
     }
 
-    let defaultsCopy = {};
-    Lang.copyProperties(defaults, defaultsCopy);
+    let defaultsCopy = Object.assign({}, defaults);
     return Object.assign(defaultsCopy, params);
 }